import request from '@/utils/request'

// 查询质量检验记录列表
export function listInspection(query) {
  return request({
    url: '/quality/inspection/list',
    method: 'get',
    params: query
  })
}

// 查询质量检验记录详细
export function getInspection(inspectionId) {
  return request({
    url: '/quality/inspection/' + inspectionId,
    method: 'get'
  })
}

// 新增质量检验记录
export function addInspection(data) {
  return request({
    url: '/quality/inspection',
    method: 'post',
    data: data
  })
}

// 修改质量检验记录
export function updateInspection(data) {
  return request({
    url: '/quality/inspection',
    method: 'put',
    data: data
  })
}

// 删除质量检验记录
export function delInspection(inspectionId) {
  return request({
    url: '/quality/inspection/' + inspectionId,
    method: 'delete'
  })
}

// 校验检验单号唯一性
export function checkInspectionCodeUnique(inspectionCode) {
  return request({
    url: '/quality/inspection/checkInspectionCodeUnique',
    method: 'get',
    data: { inspectionCode: inspectionCode }
  })
}